home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1997 August
/
Walnut Creek CDROM.7z
/
ZIPPED
/
LISTINGS
/
V_12_11.ZIP
/
ALLISON.ZIP
/
STR2.CPP
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
C/C++ Source or Header
|
1994-09-06
|
400 b
|
22 lines
LISTING 5 - Adds implementation of assignment operator to the
string class
// str2.cpp
#include <iostream.h>
#include <iomanip.h>
#include <string.h>
#include <assert.h>
#include "str2.h"
// Add this:
string& string::operator=(const string& s2)
{
if (this != &s2)
{
delete [] data;
clone(s2.data);
}
return *this;
}
// The rest as in Listing 2